feat(cre/sdk): add capability_id field to CapabilityResponse#332
feat(cre/sdk): add capability_id field to CapabilityResponse#332
Conversation
Add a top-level capability_id string field (field number 3) to the CapabilityResponse message in both v1alpha and v1beta protos. This is a backward-compatible addition that allows the host to tag error responses with the ID of the capability that failed, enabling downstream consumers to attribute workflow execution failures to specific capabilities in metrics and observability.
|
|
👋 vreff, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
The latest Buf updates on your PR. Results from workflow Regenerate Protobuf Files / buf (pull_request).
|
Populate the new CapabilityResponse.capability_id field when a capability call returns an error. This allows the workflow engine to attribute execution failures to the specific capability that caused them. Depends on: smartcontractkit/chainlink-protos#332
Add an optional failed_capability_id field (field 4) to ExecutionResult in both v1alpha and v1beta. This allows the SDK to propagate the ID of the capability that caused an execution failure, so the engine can read it directly from the result without side-channel state tracking.
Summary
Add a top-level
capability_idstring field (field number 3) to theCapabilityResponsemessage in both v1alpha and v1beta protos.Motivation
When a workflow execution fails due to a capability error, the engine currently has no structured way to attribute the failure to a specific capability in metrics. The error string crosses the WASM boundary and loses capability context.
Changes
cre/sdk/v1alpha/sdk.proto: Addedstring capability_id = 3toCapabilityResponsecre/sdk/v1beta/sdk.proto: Same change for v1betago generateCompatibility
This is a backward-compatible addition. Existing consumers ignore the new field. The field is populated by the WASM host when constructing error responses, allowing the workflow engine to include the failing capability ID in the
platform_engine_workflow_execution_failed_countmetric.Downstream PRs
chainlink-common: Setcapability_idin the WASM host error pathcre-sdk-go: Propagatecapability_idthrough the SDKchainlink: Readcapability_idfrom responses for metrics